import React, { Component } from 'react'
import "./style.scss"
class TitleCard extends Component {
    constructor(props) {
        super(props)
    }
    state = {
        isShowBcg: false
    }

    //组件挂载时触发
    componentWillMount() {

    }

    //组件完成挂载触发
    componentDidMount() {
        if (this.props.isShowBcg) {
            this.setState({
                isShowBcg: this.props.isShowBcg
            })
        }
    }

    //组件将要更新数据时触发
    componentWillUpdate() {

    }

    //组件更新数据完成时触发
    componentDidUpdate() {

    }

    //组件销毁时触发
    componentWillUnmount() {

    }

    render() {
        return (
            <div className={this.state.isShowBcg ? 'bcg title_card' : 'title_card'}>
                <div className="title">{this.props.title}</div>


                <div className={this.props.isShowBcg ? 'genduo hidden' : 'genduo'} >{this.props.children}</div>

            </div>
        )
    }
}


export default TitleCard